package com.usian.controller;

import com.usian.pojo.Orders;
import com.usian.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/order")
public class OrderController {

    @Autowired
    private OrderService orderService;

    /**
     * 下单
     *
     * @param orders
     * @return
     */
    @PostMapping("/createOrder")
    public String createOrder(@RequestBody Orders orders){
        orderService.createOrder(orders);
        return "succ";
    }


}
